package cn.kgc.springcloud.controller;

import cn.kgc.springcloud.clients.ServiceClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 课工场
 * @date 2025/1/13
 * @description
 */
@RestController
@RequestMapping("hystrix2")
public class HystrixController {

    @Resource
    private ServiceClient  serviceClient;

    @GetMapping("m1/{id}")
    public String  method1(@PathVariable("id") Integer id){

        String result = serviceClient.method1(id);

        return "HystrixController method1 ok   =>  service1 => "+result;
    }
}
